import com.adobe.cairngorm.control.CairngormEventDispatcher;

import mx.events.CloseEvent;
import mx.managers.PopUpManager;

import net.optix.ip.events.RecordTradeSecretEvent;
import net.optix.ip.model.ModelLocator;
import net.optix.ip.vo.TradeSecretVO;

[Bindable]
private var model:ModelLocator	=	ModelLocator.getInstance();

public function init():void
{
	model.bSubmit	=	true;
	model.result	=	"";
 	model.close		=	"no";
}
  			
private function titleWindow_close(evt:CloseEvent):void 
{ 
	model.result	=	"";
 	model.bSubmit	=	true;
  	PopUpManager.removePopUp(this); 
}

private function recordTradeSecret():void
{
	var vo:TradeSecretVO	=	new TradeSecretVO();
	vo.clientID				=	model.client.clientID;
	vo.tradeSecret			=	tradeSecret.text;
	vo.infExtentOut			=	infExtentOut.selectedValue;
	vo.infExtentIn			=	infExtentIn.selectedValue;
	vo.infValue				=	infValue.selectedValue;
	vo.infTime				=	infTime.selectedValue;
	vo.infDiff				=	infDiff.selectedValue;
	vo.infMeasures			=	infMeasures.selectedValue;
	
	vo.strExtentOut			=	strExtentOut.text;
	vo.strExtentIn			=	strExtentIn.text;
	vo.strValue				=	strValue.text;
	vo.strTime				=	strTime.text;
	vo.strDiff				=	strDiff.text;
	vo.strMeasures			=	strMeasures.text;
	
	var event:RecordTradeSecretEvent	=	new RecordTradeSecretEvent(vo);
	com.adobe.cairngorm.control.CairngormEventDispatcher.getInstance().dispatchEvent(event);
}
